Fix POSIX shell in the configure script
authorNikita Baksalyar <nikita.baksalyar@gmail.com>
Thu, 16 Jun 2016 05:25:18 +0000 (05:25 +0000)
committerNikita Baksalyar <nikita.baksalyar@gmail.com>
Sun, 28 Aug 2016 00:11:48 +0000 (05:11 +0500)
configure

index eccd7dd8c7fda6313f8df1a356d904a04b305733..22108f7f88cc2b03cb78f5f6411a4897c783d790 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,13 @@
 #!/bin/sh
 
+# /bin/sh on Solaris is not a POSIX compatible shell, but /usr/bin/bash is.
+if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then
+    POSIX_SHELL="true"
+    export POSIX_SHELL
+    exec /usr/bin/env bash $0 "$@"
+fi
+unset POSIX_SHELL # clear it so if we invoke other scripts, they run as bash as well
+
 msg() {
     echo "configure: $1"
 }